package com.zongxingh.falcon.mq.producer;

import org.apache.rocketmq.client.exception.MQBrokerException;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.remoting.exception.RemotingException;

/**
 * Introduction:  消息发送接口
 * Package Name:  com.zongxingh.falcon.mq.producer
 * Project Name:  mq
 * Author:  zongxingh
 * Email： zongxingh@163.com
 * Tel: 157*****778
 * Create Time:  2020/9/22 11:08
 */
public interface MsgProduce {
    /**
     * 发送消息，消息为字符串
     * @param topic 消息主题
     * @param text 文本消息
     * @return
     */
    boolean sedMessage(String topic, String text) throws InterruptedException, RemotingException, MQClientException, MQBrokerException;

    /**
     * 发送消息，消息为字节数组
     * @param topic 消息主题
     * @param bytes 消息的字节数组
     * @return
     */
    boolean sedMessage(String topic, byte[] bytes) throws InterruptedException, RemotingException, MQClientException, MQBrokerException;

}
